﻿using ServiceCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace Entity
{
    public class customer_repair_return
    {

        /// <summary>
        ///  报修ID
        /// </summary>
        public string repair_return_id { get; set; }
        /// <summary>
        ///  报修ID
        /// </summary>
        public string repair_id { get; set; }
        /// <summary>
        /// 返件类型
        /// </summary>
        public return_type return_type { get; set; }
        /// <summary>
        /// 返件单号
        /// </summary>
        public string return_express_no { get; set; }
        /// <summary>
        /// 返件备注
        /// </summary>
        public string return_des { get; set; }
        /// <summary>
        /// 返件审核状态
        /// </summary>
        public return_approval_state return_approval_state { get; set; }
        /// <summary>
        ///  返件审核备注
        /// </summary>
        public string return_approval_des { get; set; }
        /// <summary>
        ///  是否可以再次提交
        /// </summary>
        public bool can_update { get; set; }
        /// <summary>
        /// 是否最后一条  只要是新提交的就是最后一条  应在业务逻辑中约束 只要有返件 就应该有一条为true的数据
        /// </summary>
        public bool is_last { get; set; }
        /// <summary>
        /// 当前第几次提交
        /// </summary>
        public int return_sort { get; set; }
        /// <summary>
        ///  返件图片上传
        /// </summary>
        public string return_pic { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime add_time { get; set; }
        /// <summary>
        /// 修改时间 一般情况下修改时间应该等于添加时间 只有存在修改过的数据才有可能存在和添加时间不同的数据
        /// </summary>
        public DateTime update_time { get; set; }
        /// <summary>
        /// 提交审批人的UId
        /// </summary>
        public string submit_uid { get; set; }
        /// <summary>
        /// 提交审批人名称
        /// </summary>
        public string submit_uname { get; set; }
        /// <summary>
        ///  返件审批人的UID
        /// </summary>
        public string return_approval_uid { get; set; }
        /// <summary>
        ///  返件审批人名称
        /// </summary>
        public string return_approval_name { get; set; }
        /// <summary>
        ///  审核时间
        /// </summary>
        public DateTime? approval_time { get; set; }
    }

    /// <summary>
    /// 返回审核状态
    /// </summary>
    public enum return_approval_state
    {
        保存未提交 = 31,
        返件审批已提交 = 32,
        返件审批已完成 = 33,
        返件审批被驳回 = 34,
        无需返件 = -1
    }
    /// <summary>
    /// 返回审核状态类型
    /// </summary>
    public enum return_type
    {
        同意返件 = 1,
        不同意返件 = 2
    }

    /// <summary>
    ///  提交返件审核
    /// </summary>
    public class submit_return_approval_params
    {
        /// <summary>
        /// 返件ID
        /// </summary>
        public string repair_return_id { get; set; }
        /// <summary>
        /// 报修ID
        /// </summary>
        public string repair_id { get; set; }
        /// <summary>
        /// 返件类型
        /// </summary>
        public return_type? return_type { get; set; }
        /// <summary>
        /// 返件单号
        /// </summary>
        public string return_express_no { get; set; }
        /// <summary>
        /// 返件备注
        /// </summary>
        public string return_des { get; set; }
        /// <summary>
        /// 是否临时保存
        /// </summary>
        public bool? temp_save { get; set; }
        /// <summary>
        /// 返回图片数据
        /// </summary>
        public List<string> return_pic { get; set; }
    }

    #region  业务查询

    public class search_return_approval_list : Base_List_Params
    {
        /// <summary>
        /// 客户姓名
        /// </summary>
        public string customer_name { get; set; }
        /// <summary>
        /// 提交人UID
        /// </summary>
        public string submit_uid { get; set; }
        /// <summary>
        /// 返件类型
        /// </summary>
        public return_type? return_type { get; set; }
        /// <summary>
        /// 返件状态
        /// </summary>
        public return_approval_state? return_approval_state { get; set; }
        /// <summary>
        /// 审批人
        /// </summary>
        public string approval_uid { get; set; }
        /// <summary>
        ///  提交数量
        /// </summary>
        public int? submit_count { get; set; }
        /// <summary>
        /// 返件单号
        /// </summary>
        public string return_express_no { get; set; }
        /// <summary>
        /// 添加时间搜索 添加时间
        /// </summary>
        public string start_addtime { get; set; }
        /// <summary>
        /// 添加时间搜索 结束时间
        /// </summary>
        public string end_addtime { get; set; }

        /// <summary>
        /// 审核时间搜索 添加时间
        /// </summary>
        public string start_approval_time { get; set; }
        /// <summary>
        /// 审核时间搜索 结束时间
        /// </summary>
        public string end_approval_time { get; set; }
    }
    /// <summary>
    /// 返回数据
    /// </summary>
    public class return_approval_item : customer_repair_return
    {
        /// <summary>
        /// 报修时间
        /// </summary>
        public DateTime repair_time { get; set; }
        /// <summary>
        /// 客户姓名
        /// </summary>
        public string customer_uname { get; set; }
        /// <summary>
        /// 报修提交人
        /// </summary>
        public string user_name { get; set; }
        /// <summary>
        /// 返件类型
        /// </summary>
        public string return_type_str { get { return return_type.ToString(); } }

        /// <summary>
        /// 返件审核状态
        /// </summary>
        public string return_approval_state_str { get { return return_approval_state.ToString(); } }
    }
    #endregion
}
